package com.isoft.dao.tabledao;

import com.isoft.entity.tableentity.dfme_stls.DfmeStlsDflt;
import com.isoft.entity.tableentity.dfme_stls.DfmeStlsMeta;
import com.isoft.entity.tableentity.dfme_stls.DfmeStlsStnd;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;

@Mapper
public interface DfmeStlsDao {
    @Insert("insert into TEAM04.COMMON_META( create_time, sndr, rcvr, seqn, ddtm,type, styp) " +
            "values( #{create_time}, #{meta.sndr}, #{meta.rcvr}, #{meta.seqn}," +
            " #{meta.ddtm}, #{meta.type}, #{meta.styp})")
    public int insertMeta(@Param("create_time") Timestamp create_time,
                          @Param("meta") DfmeStlsMeta  dfmeStlsMeta);

    @Insert("insert into TEAM04.DFME_STLS(meta_id,create_time,flid,ffid,fide,fatt) " +
            "values(#{meta_id},#{create_time},#{dflt.flid},#{dflt.ffid},#{dflt.fide},#{dflt.fatt})")
    public int insertDflt(@Param("meta_id") int meta_id,
                          @Param("create_time") Timestamp create_time,
                          @Param("dflt") DfmeStlsDflt dfmeStlsDflt);

    @Insert("insert into TEAM04.DFME_STLS_STLS_STND(meta_id,create_time,stno,code,estr,eend,rstr,rend,cssi,btsc) "+
            "values(#{meta_id},#{create_time},#{stnd.stno},#{stnd.code},#{stnd.estr},#{stnd.eend},#{stnd.rstr}," +
            "#{stnd.rend},#{stnd.cssi},#{stnd.btsc})")
    public int insertStnd(@Param("meta_id") int meta_id,
                          @Param("create_time") Timestamp create_time,
                          @Param("stnd")DfmeStlsStnd dfmeStlsStnd);
}
